With the Related Items iPart, you can display a list of profile or product pictures based on the results of an IQA query. For example, you can write a query to display the profile pictures of everyone who has registered for an event, made a donation, or ordered a particular product, or to display products in the same category. You can configure the list to display horizontally or vertically, to display a name for the item, and to choose the size of the image. You also have the option to make the profile picture a live link that opens a URL of your choosing, such as the member profile page.
Guidelines for working with the Related Items iPart
■ The pictures displayed in the iPart are based on iMIS product or contact IDs. When creating the query for this iPart in IQA, you must select a property that returns an iMIS product or contact ID on the Display tab. Give this property an Alias of key_Id (the Alias is case sensitive).
■ To define the image to display for each record, include a column in your query that specifies the image file name for that record. Give this property an Alias of Image.
■ To display a name for each record, include a column in your query for the name of the item or contact. Give this property an Alias of Name.
■ When you add Display columns to the query in IQA, they become available within the iPart as Filter columns to filter on.
■ You can dynamically filter the query results displayed in the iPart based on the value of another iPart’s URL parameter. For example, you can set up your donation page to display the profile pictures of people that have donated to a particular cause (called a distribution in iMIS). The Donation Creator iPart uses the URL parameter itemid to determine which distribution the donation should go towards. If you add your iPart to the same content record as the Donation Creator, then you can set up the Related Items iPart to look at the value of itemid to determine which profile pictures to display. You just have to make sure that your query includes the CsActivity.Product Code property, so that you can select it as a Filter column on the iPart’s configuration page. Once selected, enter itemid for the Filter on URL parameter, so that the iPart knows to filter the results based on that URL parameter’s value.
Example: Display other products in the same category
In this example, the Related Items iPart is set up to display clickable images for other products in the same category as a particular product. This example uses content installed for the sample Member site.
1. From Content Management > Content designer > Manage content, open the Store > StoreLayouts folder and edit the Item Detail content record.Core Content > CommerceProduct Display
Note: The Item Detail content record displays product pages in the Member sample site’s Shop. The product displayed is based on the value of the URL parameter iProductCode. iProductID.
2. Click add content to find and select the Related Items iPart in the Utility folder.
3. For the Source query, click select to find and select the RelatedProducts query located in $/Samples/RelatedItems.
4. From the Filter column dropdown list, select ProductCategory. ProductClassKey.
5. For the Filter on URL parameter, enter Category.Class.
6. For the Items link to (URL or shortcut), enter ItemDetail?iProductCode={key_Id}&Category={ProductCategory}. ItemDetail?iProductID={key_Id}&Class={ProductClassKey This uses the ItemDetail shortcut to link each item in the list to the product page. The particular item’s product ID and category are specified in URL parameters so that the correct product and related products are displayed in the resulting product page.
7. Save and Publish the content record.
Example: Display other users who have purchased a product
In this example, the Related Items iPart is set up to display clickable profile pictures of other users who have bought a particular product. This example uses content installed for the sample Member site.
1. From Content Management > Content designer > Manage content, open the Store > StoreLayouts folder and edit the Item Detail content record.Core Content > CommerceProduct Display .
Note: The Item Detail content record displays product pages in the Member sample site’s Shop. The product displayed is based on the value of the URL parameter iProductCode. iProductID.
2. Click add content to find and select the Related Items iPart in the Utility folder.
3. For the Source query, click select to find and select the Orders query located in $/Samples/QueryProfilePictureList.
4. From the Filter column dropdown list, select ProductCode.
5. For the Filter on URL parameter, enter iProductCode. iProductID.
6. For the Items link to (URL or shortcut), enter MBR/Party.aspx. This redirector web page looks for an ID in the URL parameter and then checks the ID’s party type and the user’s permissions to determine which content record to display. The user’s ID is appended to any URL specified in this field.
7. Save and Publish the content record.